using System;

namespace NET.Library.Manipulation
{
	/// <summary>
    /// Integers Manipulation Object.
	/// </summary>
	public class Integers
	{
		/// '-----------------------------------------------------------------------------------------
		/// 'returns integer values
		/// '-----------------------------------------------------------------------------------------
		public static int intGetVal(object Value)
		{
			return Value == DBNull.Value ? int.MinValue : (int)Value;
		}

        /// '-----------------------------------------------------------------------------------------
        /// <summary>
        /// Checks if a string is a numeric (int) value.
        /// </summary>
        /// <param name="stringToCheck"></param>
        /// <returns></returns>
        /// '-----------------------------------------------------------------------------------------
        public static bool IsNumeric(string stringToCheck)
        {
            int result;
            bool isNumeric = true;
            if (stringToCheck == null)
            {
                stringToCheck = "";
            }
            try
            {
                result = int.Parse(stringToCheck);
            }
            catch
            {
                isNumeric = false;
            }
            return isNumeric;
        }

	}
}
